using Microsoft.Modeling.StoryboardDesigner.Extensions.Features.HighlightLinkedShapes;
using Microsoft.VisualStudio.Modeling.Validation;
using System.Globalization;

namespace Microsoft.Modeling.StoryboardDesigner
{
    [ValidationState(ValidationState.Enabled)]
    partial class NamedElement
    {
        [ValidationMethod(ValidationCategories.Save|ValidationCategories.Menu)]
        private void ValidateName(ValidationContext context)
        {
            if(string.IsNullOrEmpty(this.Name))
            {
                context.LogError(
                    string.Format(CultureInfo.CurrentCulture, Properties.Resources.ValidationNameRequired),
                    string.Format(CultureInfo.CurrentCulture,Properties.Resources.ValidationErrorCode), this);
            }
        }
    }
}